package config;

import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.HandlerExceptionResolver;
import org.springframework.web.servlet.config.annotation.*;

import java.util.List;

@Configuration
@ComponentScan("com.guigu.www")
@EnableWebMvc
public class SpringMVC implements WebMvcConfigurer {

    //视图解析器
    public void view(ViewResolverRegistry registry) {
        registry.jsp("", "");
    }

    //静态资源
    public void setRegistry(ResourceHandlerRegistry registry) {
        registry.addResourceHandler("/js/**").addResourceLocations("/js");
        registry.addResourceHandler("/css/**").addResourceLocations("/css");
        registry.addResourceHandler("/image/**").addResourceLocations("/image");
    }

    //指定 异常处理器
    public void addException(List<HandlerExceptionResolver> list) {
        //list.add();
    }

    //拦截器
    public void addInterceptor(InterceptorRegistry registry) {
        //registry.addInterceptor(null).addPathPatterns("/**").excludePathPatterns("");
    }



}
